var url = http = "http://192.168.31.9:18080/SJSPro/qyqj/";   //线上地址
var app = new Vue({
  el: '#companyDetail',
  components: {
    'left-bar': leftNav
  },
  data: {
    nav_title: "企业画像",
    active_nav: "企业全景",
    uni_scid: '',
    healthGrade: '',
    company_collect: false,           //公司是否收藏
    company_industry: '',   //行业领域
    tag_title: ['基本信息', '纳税信息', '社保缴纳', '行政处罚', '疫苗接种', '工商税务变更', '政策兑现', '储备项目'],           //当前所有的页面标签，去掉了原有的信用中国
    en_tab_title: ['jbxx', 'nsxx', 'sbjn', 'xzcf', 'ymjz', 'gsswbg', 'zcdx', 'cbxm'],//去掉了原有的xyzg
    active_tag: '基本信息',    //当前所选中的标签
    tag_index: 'jbxx',              //当前展示的标签索引
    feedback: true,                 //是否展示返回主页，返回顶部按钮
    baseInfo: [],
    concactData: [],
    qiyedjInfo: [],       //基本信息
    getEntPayTax: [],      //纳税信息
    getSocialSec: [],      //社保缴纳
    e_ic_move_imp_m: [],      //工商迁入
    getPolicyToCash: [],      //政策兑现
    getEntAdmin: [],      //行政处罚
    getVaccination: [],      //疫苗接种
    getReservePrj: [],      //储备项目
    e_ic_move_exp_m: [],       //工商_迁出记录
    e_reg_ent: [],           //注册企业表
    e_revoke_ent: [],      //注吊销企业表
    e_tax_move_imp: [],      //税务_迁入记录
    e_tax_move_exp: [],     //税务_迁出记录
    e_policy_to_cash: [],    //政策兑现记录
    e_talent_introduce_settle: [],      //人才引进落户
    e_child_to_school: [],   //协调子女入园入学
    e_keyent_child_to_school: [],   //重点企业员工子女入园入学
    e_pub_house: [],     //公租房情况
    e_nopeking_graduate_settle: [],    //非京籍应届生落户
    e_census_register_allot: [],      //户口指标分配
    e_house_rent_subsidy: [],     //房租补贴
    e_oversea_stdu_settle: [],     //留学生引进落户
    e_excellent_talent: [],     //景贤人才情况
    e_work_residence_permit: [],  //工作居住证
  },
  created: function () {
    this.uni_scid = this.getQueryString("uni_scid");
    this.init();
  },

  methods: {
    init: function () {

      var _this = this;
      _this.tag_jump(0);
      _this.$http.get(url + '/getEntList?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

        _this.qiyedjInfo = response.body[0][0]

      })


    },
    getQueryString: function (name) {
      var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
      var r = window.location.search.substr(1).match(reg);
      if (r != null) {
        return decodeURI(r[2]);
      } else {
        return null;
      }
    },

    website_href: function (href_url) {
      if (href_url.length > 7) {
        window.open(href_url)
      } else {
        return false;
      }
    },
    tag_jump: function (index) {
      var _this = this
      this.active_tag = this.tag_title[index];  //切换标签
      this.tag_index = this.en_tab_title[index];      //切换页面

      if (this.tag_index == 'nsxx') {
        _this.$http.get(url + '/getEntPayTax?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.getEntPayTax = response.body[0][0]

        })

      } else if (this.tag_index == 'sbjn') {
        _this.$http.get(url + '/getSocialSec?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.getSocialSec = response.body[0][0]


        })

      } else if (this.tag_index == 'xzcf') {
        _this.$http.get(url + '/getEntAdmin?entno=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.getEntAdmin = response.body[0][0]


        })

      } else if (this.tag_index == 'ymjz') {
        _this.$http.get(url + '/getVaccination?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.getVaccination = response.body[0][0]


        })

      } else if (this.tag_index == 'gsswbg') {
        _this.$http.get(url + '/getIcChange?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.e_ic_move_imp_m = response.body[0].e_ic_move_imp_m[0]                    //工商迁入
          _this.e_ic_move_exp_m = response.body[0].e_ic_move_exp_m[0]        //工商_迁出记录
          _this.e_reg_ent = response.body[0].e_reg_ent[0]               //注册企业表
          _this.e_revoke_ent = response.body[0].e_revoke_ent[0]         //注吊销企业表
          _this.e_tax_move_imp = response.body[0].e_tax_move_imp[0]        //税务_迁入记录
          _this.e_tax_move_exp = response.body[0].e_tax_move_exp[0]       //税务_迁出记录


        })

      } else if (this.tag_index == 'zcdx') {
        _this.$http.get(url + '/getPolicyToCash?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {


          _this.e_policy_to_cash = response.body[0].e_policy_to_cash[0]       //政策兑现记录
          _this.e_talent_introduce_settle = response.body[0].e_talent_introduce_settle[0]       //人才引进落户
          _this.e_child_to_school = response.body[0].e_child_to_school[0]        //协调子女入园入学
          _this.e_keyent_child_to_school = response.body[0].e_keyent_child_to_school[0]       //重点企业员工子女入园入学
          _this.e_pub_house = response.body[0].e_pub_house[0]       //公租房情况
          _this.e_nopeking_graduate_settle = response.body[0].e_nopeking_graduate_settle[0]       //非京籍应届生落户
          _this.e_census_register_allot = response.body[0].e_census_register_allot[0]      //户口指标分配
          _this.e_house_rent_subsidy = response.body[0].e_house_rent_subsidy[0]       //房租补贴
          _this.e_oversea_stdu_settle = response.body[0].e_oversea_stdu_settle[0]       //留学生引进落户
          _this.e_excellent_talent = response.body[0].e_excellent_talent[0]        //景贤人才情况
          _this.e_work_residence_permit = response.body[0].e_work_residence_permit[0]        //工作居住证


        })

      } else if (this.tag_index == 'cbxm') {
        _this.$http.get(url + '/getReservePrj?uni_scid=' + encodeURI(_this.uni_scid)).then(function (response) {

          _this.getReservePrj = response.body[0][0]


        })

      }





    },




  }
})
Vue.filter("newsStr", function (value) {
  if (value.length > 80) {
    return value = value.substr(0, 80) + "...";
  } else {
    return value;
  }
})
//时间格式
Vue.filter("time", function (value) {
  return value.replace(/-/g, "/");
})

























